import axios, { type AxiosResponse, type AxiosRequestHeaders } from "axios";
import pinia from "@/stores/index";

// 配置新建一个 axios 实例
const service = axios.create({
  baseURL: import.meta.env.VITE_API_MOCK,
  timeout: 50000,
});

// 添加请求拦截器
service.interceptors.request.use((config) => {
  return config;
});

// 添加响应拦截器
service.interceptors.response.use((req) => {
  return req.data.data;
});

export default service;
